<!--
 * @Description: 
 * @Author: 赵华宇
 * @Date: 2025-04-25 14:58:10
 * @LastEditors: 赵华宇
 * @LastEditTime: 2025-04-25 15:00:29
-->
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>堆叠层级</title>
    <style>
        div{
            position: absolute;
            width: 200px;
            height: 200px;
        }
        .box1{
            background-color: pink;
            /* 取值是整数，默认是0，取值越大显示顺序越靠上 */
            z-index: 1;
        }
        .box2{
            background-color: skyblue;
            left:100px;
            top:100px;
            z-index: 2;
        }
    </style>
</head>
<body>
    <div class="box1">box1</div>
    <div class="box2">box2</div>
</body>
</html>